<!DOCTYPE html>
<html>
<head>
    <#assign dicSelect=JspTaglibs["http://www.casic304.cn/dicSelect"] />
    <#assign secSelect=JspTaglibs["http://www.casic304.cn/secSelect"] />
    <#assign fillDept=JspTaglibs["http://www.casic304.cn/fillDept"] />
    <meta charset="utf-8">
    <title>紧急例外放行基本信息</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="${ctx}/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="${ctx}/qbdmsStatic/iconfont/iconfont.css"/>
    <link rel="stylesheet" href="${ctx}/qbdmsStatic/style/qbdms.css">
    <script type="text/javascript">
        var __ctx = "${ctx}";
    </script>
</head>
<body class="listBody qbdms-particulars">
<div class="qbdms-bodyDiv">
    <div class="layui-table-view-body qbdms-add-view-body">
        <div class="qbdms-formTitle">紧急例外放行 <i class="qbdms-returnOn closeWindow">返回</i></div>
        <form class="layui-form formPreview" requrl="${ctx}/qbdms/wQbdEmergentPass/get" lay-filter="wQbdEmergentPassDataForm">
            <div class="" style="width: 100%;">
                <table class="tableExcel qbdms-zeroTable" width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr id="tbxx"></tr>
                    <tr>
                        <td class="qbdms-zeroTable-lable">密级<span style="color: red;">*</span></td>
                        <td ><@secSelect.sec_select data_src=1 required=true name="secret"/></td>
                        <td class="qbdms-zeroTable-lable">编号<span style="color: red;">*</span></td>
                        <td name="registernum"></td>
                        <td class="qbdms-zeroTable-lable">型号<span style="color: red;">*</span></td>
                        <td name="model"></td>
                    </tr>
                    <tr>
                        <td class="qbdms-zeroTable-lable">产品名称<span style="color: red;">*</span></td>
                        <td name="productname"></td>
                        <td class="qbdms-zeroTable-lable">产品代号<span style="color: red;">*</span></td>
                        <td name="productsymbol"></td>
                        <td class="qbdms-zeroTable-lable">产品编号<span style="color: red;">*</span></td>
                        <td name="productnum"></td>
                    </tr>
                        <tr>
                                <td class="qbdms-zeroTable-lable">数量<span style="color: red;">*</span></td>
                                <td name="totalnum"></td>
                                <td class="qbdms-zeroTable-lable">放行地点<span style="color: red;">*</span></td>
                                <td name="passplace"></td>
                        </tr>
                        <tr>
                                <td class="qbdms-zeroTable-lable">放行时间<span style="color: red;">*</span></td>
                                <td name="passtime"></td>
                                <td class="qbdms-zeroTable-lable">放行类别<span style="color: red;">*</span></td>
                                <td name="passcategory"></td>
                                <td class="qbdms-zeroTable-lable">闭环时间/放行结点<span style="color: red;">*</span></td>
                                <td name="closelooptime"></td>
                        </tr>
                        <tr>
                                <td class="qbdms-zeroTable-lable">放行理由描述<span style="color: red;">*</span></td>
                                <td name="passreason"></td>
                                <td class="qbdms-zeroTable-lable">流程状态<span style="color: red;">*</span></td>
                                <td name="status"></td>
                                <td class="qbdms-zeroTable-lable">跟踪处理结果<span style="color: red;">*</span></td>
                                <td name="followresult"></td>
                        </tr>
                        <tr>
                                <td class="qbdms-zeroTable-lable">责任人<span style="color: red;">*</span></td>
                                <td name="dutyperson"></td>
                                <td class="qbdms-zeroTable-lable">跟踪处理结果验证<span style="color: red;">*</span></td>
                                <td name="followresultcheck"></td>
                                <td class="qbdms-zeroTable-lable">检验员<span style="color: red;">*</span></td>
                                <td name="inspector"></td>
                        </tr>
                    <tr>
                        <td class="qbdms-zeroTable-lable">
                            紧急例外放行单上传
                        </td>
                        <td colspan="5">
                            <div class="uploadFileList" fileUploadName="passurl"></div>
                        </td>
                    </tr>
                    </tbody>
                </table>
                            <input name="passtime" type="hidden" placeholder="未填写" autocomplete="off" class="layui-input dateTimeFiled input-right time-init" format="yyyy-MM-dd" datetype="date" />
                            <input name="closelooptime" type="hidden" placeholder="未填写" autocomplete="off" class="layui-input dateTimeFiled input-right time-init" format="yyyy-MM-dd" datetype="date" />
            </div>
            <div class="layui-form-item btnformItem">
                <p>
                    <button type="reset" id="closeWindow" class="layui-btn layui-btn-sm btn-save qbdms-oneBtnLine">返回</button>
                </p>
            </div>
        </form>
    </div>
</div>
<script src="${ctx}/qbdmsStatic/public/configFile.js"></script>
<script src="${ctx}/layui/layui.js"></script>
<script>
    layui.config({
        base: serverPath.qbdmsPath + staticPath.qbdmsPath //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'setter', 'layer', 'propsHandle', 'upload', 'common', 'laydate', 'jquery', 'publicMethods', 'qbdmsForm'], function () {
        // -----常量声明----------
        var $ = layui.jquery,
            laydate = layui.laydate,
            setter = layui.setter,  // 配置信息
            layer = layui.layer,
            common = layui.common,
            propsHandle = layui.propsHandle,
            upload = layui.upload,
            publicMethods = layui.publicMethods,
            formId = '' || '',
            form = layui.qbdmsForm;
        $(".subContTem").hide()

        var defProps = {
            //viewMould: 'form/formDef/view/formDesign/moulds/', // 组件模块 存放文件 *****
            viewMould: 'moulds/', // 组件模块 存放文件 *****
            selectorBtn: '.selectorBtn'
        };
        var temQuery = new propsHandle();  // 实例化模板功能部分
        temQuery.initTem({
            selectorBtn: defProps.selectorBtn,
            selectorTemPath: setter.views + defProps.viewMould
        });

        var dateTimeFiledLen = $(".dateTimeFiled");
        for (var i = 0; i < dateTimeFiledLen.length; i++) {
            laydate.render({
                elem: dateTimeFiledLen[i] //指定元素
                , type: 'date'
                , trigger: 'click'
            });
        }
        //关闭当前页面
        //关闭当前页面
        $("#closeWindow,.closeWindow").click(function () {
            window.location.href ='${ctx}/qbdms/wQbdEmergentPass/view/list';
        });

        var runId = "${runId}";
        if (runId == null || runId == '') {
            $("#hideAndShow").show();
        }

        var common = layui.common;
        common.updateForm({
            name: 'wQbdEmergentPassDataForm',
            idValue: "${id}",
            primary: "id",
            getCallback: function (data) {
                $("#tbxx").html("<td class='qbdms-zeroTable-lable'>填报信息:</td><td colspan='5' class=''>【" + data.data.filldept + " | " + data.data.fillman + " | " + data.data.filldate + "】</td>");

                // $("#tbxx").html("<span class='qbdms-TBinformation'>填报信息:</span><span class='qbdms-TBinformationText'>【" + data.data.filldept + " | " + data.data.fillman + " | " + data.data.filldate + "】</span>");
                $("input[name='trialpeople']").attr("ids", data.data.trialpeopleid);
                $("input[name='dutyperson']").attr("ids", data.data.dutypersonid);
                $("input[name='inspector']").attr("ids", data.data.inspectorid);

                //-修改页面 初始化附件组件 开始 ------------------------------------------
                $('.uploadFileList').each(function () {
                    var fileUploadName = $(this).attr("fileUploadName");
                    var jsonFile = data.data[fileUploadName];
                    var files = eval(jsonFile);

                    if (files) {
                        for (var i = 0; i < files.length; i++) {
                            var fileLevel = files[i].fileLevel;
                            var fileLevelText = files[i].fileLevelText;
                            var fileSec = '<div class="fileSecLevel fileSecXg layui-input-inline">' + '<@secSelect.sec_select data_src=1 hasBlank=false/>' + "</div>";
                            var newStr = '<span class="file-id" style="margin-right: 20px;" fileId=' + files[i].fileId + ' fileLevelText="' + fileLevelText + '">' + fileSec + '<span class="file-name" title="点击下载文件" onclick="downFile(this)"><i class="iconfont" style="margin-right: 5px"></i>' + files[i].fileName + '</span></span>';
                            $(this).html(newStr);
                            $(this).find("select:last").val(fileLevel);
                            $(this).find("select:last").attr("disabled", "disabled");
                        }
                    } else {
                        $(this).html("<span style='color: #c0c4cc'>未上传</span>");
                    }
                });
                //-修改页面 初始化附件组件 结束 ------------------------------------------
            }
        });

        //下载附件
        window.downFile = function (obj) {
            var fileId = $(obj).parents("span").attr("fileId");
            window.location.href = serverPath.qbdmsPath + setter.extendLinkPath + "attachFile/download?fileId=" + fileId;
        }

        publicMethods.bottomFixd()
        $("body *").not("#closeWindow").attr("disabled", "disabled");
        $(".uploadFileCont .qbdms-fileUp,.uploadFileCont i,.addFormTr1").hide();
        $(".uploadFileCont").each(function () {
            if ($(this).children('.uploadFileList').children().length == 0) {
                $(this).children('.uploadFileList').append("<span style='color: #C0C4CC'>未上传</span>")
            }
        })

    });
</script>
</body>
</html>